﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VSXtra.Editors;
using VSXtra.Windows;

namespace AndreySmirnov.BLToolkitUtils.VSPackage
{
	public class BLTConfigFileEditorPane : EditorPaneBase<BLToolkitUtilsPackage, BLTConfigFileEditorFactory, BLTConfigFileEditorControlHost>
	{
		public BLTConfigFileEditorPane()
		{
// ReSharper disable DoNotCallOverridableMethodsInConstructor
			UIControl.Modified += UIControl_Modified;
// ReSharper restore DoNotCallOverridableMethodsInConstructor
		}

		void UIControl_Modified()
		{
			OnContentChanged();
		}

		protected override string GetFileExtension()
		{
			return BLToolkitUtilsPackage.SETTINGS_FILE_EXTENSION;
		}

		protected override void LoadFile(string fileName)
		{
			UIControl.LoadFile(fileName);
		}

		protected override void SaveFile(string fileName)
		{
			UIControl.SaveFile(fileName);
			OnContentChanged();
		}
	}
}

